const vscode = require('vscode');


module.exports = function(context) {
    //引入Jquery
    context.subscriptions.push(vscode.commands.registerCommand('extension.importJquery', () => {
        var editor = vscode.window.activeTextEditor;
        if (editor) {
            var jqueryUrl = vscode.workspace.getConfiguration().get('vscodePluginDemo.jqueryUrl');
            var selection = editor.selection;

 
            editor.edit((editBuilder) => {
                let str=`<script type="text/javascript" src="${jqueryUrl}"></script>`
                editBuilder.replace(selection, str);
            });

 
            //vscode.window.showInformationMessage(text);
        }else{
            // 报错
        }
        
    }));

     //引入Vue
     context.subscriptions.push(vscode.commands.registerCommand('extension.importVue', () => {
        var editor = vscode.window.activeTextEditor;
        if (editor) {
            var jqueryUrl = vscode.workspace.getConfiguration().get('vscodePluginDemo.VueUrl');
            var selection = editor.selection;

 
            editor.edit((editBuilder) => {
                let str=`<script type="text/javascript" src="${jqueryUrl}"></script>`
                editBuilder.replace(selection, str);
            });

 
            //vscode.window.showInformationMessage(text);
        }else{
            // 报错
        }
        
    }));

    


};